<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html 	xmlns="http://www.w3.org/1999/xhtml"
    	xmlns:ui="http://java.sun.com/jsf/facelets"
    	xmlns:f="http://java.sun.com/jsf/core"
    	xmlns:h="http://java.sun.com/jsf/html"
    	xmlns:p="http://primefaces.org/ui"
    	xmlns:ec="http://www.b2cexpress.com.br/ecommerce"
    	xmlns:s="http://www.suricattus.com.br/jsf/ui"
		xmlns:sf="http://www.suricattus.com.br/jsf/fn"
    	xmlns:composite="http://java.sun.com/jsf/composite">
    	
	<composite:interface>
		<composite:attribute name="listaBanners" required="true" />
		<composite:attribute name="height" />
		<composite:attribute name="width" />
		<composite:attribute name="style" />
	</composite:interface>
	
	<composite:implementation>
	
		<ui:repeat var="_banner" value="#{cc.attrs.listaBanners}">
			<h:panelGroup rendered="#{_banner.posicao ne 'DETALHES'}">
				<h:panelGroup rendered="#{_banner.link ne null}">
					<a href="#{_banner.link}" target="blank">
						<p:graphicImage url="#{_banner.imagem.link}" style="height:#{cc.attrs.height}; width:#{cc.attrs.width}; #{sf:getDefaultValue(cc.attrs.style, '')}" />
					</a>
				</h:panelGroup>
				
				<h:panelGroup rendered="#{_banner.item ne null}">
					<h:link outcome="pretty:detalharItem" target="_blank">
						<f:param name="id" value="#{_banner.item.id}" />
						<f:param name="nome" value="#{_banner.item.tituloSemAcento}" />
						<p:graphicImage url="#{_banner.imagem.link}" style="height:#{cc.attrs.height}; width:#{cc.attrs.width}; #{sf:getDefaultValue(cc.attrs.style, '')}" />
					</h:link>
				</h:panelGroup>
				
				<h:panelGroup rendered="#{_banner.link eq null and _banner.item eq null}">
					<p:graphicImage url="#{_banner.imagem.link}" style="height:#{cc.attrs.height}; width:#{cc.attrs.width}; #{sf:getDefaultValue(cc.attrs.style, '')}" />
				</h:panelGroup>
			</h:panelGroup>
			
			<h:panelGroup rendered="#{_banner.posicao eq 'DETALHES'}">
				<h:panelGroup rendered="#{_banner.link ne null}">
					<a href="#{_banner.link}" target="blank">
						<img src="#{_banner.imagem.link}" style="height:#{cc.attrs.height}; width:#{cc.attrs.width}; #{sf:getDefaultValue(cc.attrs.style, '')}" />
					</a>
				</h:panelGroup>
				
				<h:panelGroup rendered="#{_banner.link eq null}">
					<img src="#{_banner.imagem.link}" style="height:#{cc.attrs.height}; width:#{cc.attrs.width}; #{sf:getDefaultValue(cc.attrs.style, '')}" />
				</h:panelGroup>
			</h:panelGroup>
			
			<h:panelGroup rendered="#{_banner.posicao ne 'TOPO'}">
				<br/>
			</h:panelGroup>
		</ui:repeat>
	
	</composite:implementation>
	
</html>
